package com.pzh.assignment.common.bean.vo;

import com.pzh.assignment.entity.User;
import lombok.Data;

@Data
public class UserVO {
    private String account;
    private String username;
    private String role;
    private String group;
    private String phone;
    private String email;

    public static UserVO valueOf(User user, String role, String group){
        UserVO vo = new UserVO();
        vo.setAccount(user.getAccount());
        vo.setUsername(user.getUsername());
        vo.setRole(role);
        vo.setGroup(group);
        vo.setPhone(user.getPhone());
        vo.setEmail(user.getEmail());
        return vo;
    }

    public static UserVO valueOf(User user){
        UserVO vo = new UserVO();
        vo.setAccount(user.getAccount());
        vo.setUsername(user.getUsername());
        vo.setPhone(user.getPhone());
        vo.setEmail(user.getEmail());
        return vo;
    }
}
